package demo1223.am;

import java.io.File;

/*
1.public static File[] listRoots();列出计算机中所有的盘符
2.public String[] list();
返回当前目录下的所有文件的路径字符串形式;
3.public File[] listFiles();
返回当前目录下的所有文件的路径File路径形式;


 */
public class Demo_03 {
    public static void main(String[] args) {
        File file = new File("src");
        File[] files = file.listFiles();
        for (File f : files) {
            System.out.println(f);
        }
    }

    public static void demo02() {
        File file = new File("D:\\");
        String[] list = file.list();
        for (String s : list) {
            System.out.println(s);
        }
    }

    public static void demo01() {
        File[] files = File.listRoots();
        for (File f : files) {
            System.out.println(f);
        }
    }
}
